package edu.uniquindio.prmaven.proyectofinal;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.testng.annotations.Test;

import edu.uniquindio.prmaven.general.TestCore;

public class InputMask_2 extends TestCore {
	
	@Test()
	/**
	dataProviderClass = edu.uniquindio.prmaven.dataprovider.DataProviderFactory.class, 
	dataProvider = ConfigurationConstants.DP_FACTORY
	@DataProviderArguments(ConfigurationConstants.ESCENARIO
			+ ConfigurationConstants.EQUALS + DataProvidersConstants.HOJA_1)
			**/
	
	public void testInputMask_2() throws Exception {
		
		try {
			
		selenium.open("/showcase/");
		
		//selenium.click("id=SubMenu-Input"); Seleccionar menu Input
		WebElement menuInput=driver.findElement(By.id("SubMenu-Input"));
		menuInput.click();
		
		//selenium.click("link=• InputMask");Seleccionar Submenu InputMask 
		//.//*[@id='MENUSIDEindent']/div[3]/a[10]
		WebElement submenuInputMask=driver.findElement(By.xpath
				("//*[@id='MENUSIDEindent']/div[3]/a[10]"));
		submenuInputMask.click();
		
		selenium.waitForPageToLoad("30000");
		
		//xpath .//*[@id='j_idt88:key']
		WebElement campoProducK=driver.findElement(By.xpath("//*[@id='j_idt88:key']"));
		campoProducK.click();
				
		WebElement ingresarTex=driver.findElement(By.xpath("//*[@id='j_idt88:key']"));
		ingresarTex.sendKeys("df-222-e456");
	
		//selenium.click("id=j_idt88:j_idt96"); xpath .//*[@id='j_idt88:j_idt96'] boton reset
		WebElement botonReset=driver.findElement(By.xpath("//*[@id='j_idt88:j_idt96']"));
		botonReset.click();
		
		//assertEquals(selenium.getValue("id=j_idt88:key"), "__-___-____"); Evaluar campo vacio
		Assert.assertEquals(selenium.getValue("id=j_idt88:key"), "__-___-____");
		
	}catch(AssertionError e){
		System.out.println("no se encontro texto");
	}finally{
		
	}
}

}


